package com.wargameproject.cartes;

import android.os.Bundle;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TableLayout;

import com.wargameproject.Case;
import com.wargameproject.Partie;
import com.wargameproject.R;
import com.wargameproject.WarGameProjectActivity;
import com.wargameproject.terrain.*;
import com.wargameproject.unite.Tour;

import android.widget.LinearLayout;

/*
 * MAP2 = MAP1
 */
/*
public class Map2 { 
	
	Button boutonTest;
	Partie partie = new Partie();
	TableLayout grille;
	LinearLayout lignes[] = new LinearLayout[partie.getNbLignes()];
	
	public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		
		for (int i = 0; i < partie.getNbLignes(); i++) {
			lignes[i] = new LinearLayout(this);
			grille.addView(lignes[i]);
			for (int j = 0; j < partie.nbColonnes; j++) {

				partie.cases[i][j] = new Case(this, i, j);

				
				 // Map 1 - Mettre dans partie ou dans une nouvelle classe
				 // (nouveau package Map ?)
				 
				//Map1 map = new Map1(); PACKAGE MAP1
				//map.CreationMap1();

				if (i == 0) {
					if (j == 0) {
						partie.cases[i][j].terrain = new Plaine();
					} else if (j < 2) {
						partie.cases[i][j].terrain = new Plaine();
					} else if (j < 3) {
						partie.cases[i][j].terrain = new Foret();
					} else if (j < 9) {
						partie.cases[i][j].terrain = new Mer();
					} else if (j < 10) {
						partie.cases[i][j].terrain = new Foret();
					} else {
						partie.cases[i][j].terrain = new Mer();
					}
				} else if (i == 1) {
					if (j < 2) {
						partie.cases[i][j].terrain = new Plaine();
					} else if (j < 9) {
						partie.cases[i][j].terrain = new Desert();
					} else {
						partie.cases[i][j].terrain = new Foret();
					}
				} else if (i == 2) {
					if (j == 0) {
						partie.cases[i][j].terrain = new Foret();
					} else if (j < 5) {
						partie.cases[i][j].terrain = new Desert();
					} else if (j < 6) {
						partie.cases[i][j].terrain = new Neige();
					} else if (j < 8) {
						partie.cases[i][j].terrain = new Desert();
					} else if (j < 9) {
						partie.cases[i][j].terrain = new Foret();
					} else if (j < 10) {
						partie.cases[i][j].terrain = new Desert();
					} else {
						partie.cases[i][j].terrain = new Foret();
					}
				} else if (i == 3) {
					if (j < 3) {
						partie.cases[i][j].terrain = new Mer();
					} else if (j < 4) {
						partie.cases[i][j].terrain = new Desert();
					} else if (j < 6) {
						partie.cases[i][j].terrain = new Neige();
					} else if (j < 9) {
						partie.cases[i][j].terrain = new Montagne();
					} else if (j < 10) {
						partie.cases[i][j].terrain = new Desert();
					} else {
						partie.cases[i][j].terrain = new Mer();
					}
				} else if (i == 4) {
					if (j == 0) {
						partie.cases[i][j].terrain = new Mer();
					} else if (j < 3) {
						partie.cases[i][j].terrain = new Desert();
					} else if (j < 5) {
						partie.cases[i][j].terrain = new Neige();
					} else if (j < 8) {
						partie.cases[i][j].terrain = new Montagne();
					} else if (j < 10) {
						partie.cases[i][j].terrain = new Desert();
					} else {
						partie.cases[i][j].terrain = new Mer();
					}
				} else if (i == 5) {
					if (j < 2) {
						partie.cases[i][j].terrain = new Desert();
					} else if (j < 4) {
						partie.cases[i][j].terrain = new Neige();
					} else if (j < 7) {
						partie.cases[i][j].terrain = new Montagne();
					} else if (j < 9) {
						partie.cases[i][j].terrain = new Neige();
					} else {
						partie.cases[i][j].terrain = new Desert();
					}
				} else if (i == 6) {
					if (j < 1) {
						partie.cases[i][j].terrain = new Mer();
					} else if (j < 3) {
						partie.cases[i][j].terrain = new Desert();
					} else if (j < 6) {
						partie.cases[i][j].terrain = new Montagne();
					} else if (j < 8) {
						partie.cases[i][j].terrain = new Neige();
					} else if (j < 10) {
						partie.cases[i][j].terrain = new Desert();
					} else {
						partie.cases[i][j].terrain = new Mer();
					}
				} else if (i == 7) {
					if (j < 1) {
						partie.cases[i][j].terrain = new Mer();
					} else if (j < 2) {
						partie.cases[i][j].terrain = new Desert();
					} else if (j < 5) {
						partie.cases[i][j].terrain = new Montagne();
					} else if (j < 7) {
						partie.cases[i][j].terrain = new Neige();
					} else if (j < 8) {
						partie.cases[i][j].terrain = new Desert();
					} else {
						partie.cases[i][j].terrain = new Mer();
					}
				} else if (i == 8) {
					if (j < 1) {
						partie.cases[i][j].terrain = new Foret();
					} else if (j < 2) {
						partie.cases[i][j].terrain = new Desert();
					} else if (j < 3) {
						partie.cases[i][j].terrain = new Foret();
					} else if (j < 5) {
						partie.cases[i][j].terrain = new Desert();
					} else if (j < 6) {
						partie.cases[i][j].terrain = new Neige();
					} else if (j < 10) {
						partie.cases[i][j].terrain = new Desert();
					} else {
						partie.cases[i][j].terrain = new Foret();
					}
				} else if (i == 9) {
					if (j < 2) {
						partie.cases[i][j].terrain = new Foret();
					} else if (j < 10) {
						partie.cases[i][j].terrain = new Desert();
					} else {
						partie.cases[i][j].terrain = new Plaine();
					}
				} else {
					if (j < 1) {
						partie.cases[i][j].terrain = new Mer();
					} else if (j < 3) {
						partie.cases[i][j].terrain = new Foret();
					} else if (j < 8) {
						partie.cases[i][j].terrain = new Mer();
					} else if (j < 9) {
						partie.cases[i][j].terrain = new Foret();
					} else if (j < 10) {
						partie.cases[i][j].terrain = new Plaine();
					} else {
						partie.cases[i][j].terrain = new Plaine();
					}
				}
				
				partie.cases[i][j].terrain.position = partie.cases[i][j];
				partie.cases[i][j].setOnClickListener(this);
				partie.cases[i][j].setMinimumWidth(75);
				partie.cases[i][j].setMaxWidth(75);
				partie.cases[i][j].setMinimumHeight(75);
				partie.cases[i][j].setMaxHeight(75);
				lignes[i].addView(partie.cases[i][j]);
				}
			
			}
		
		 // Placement des bases arbitrairement
		 
		partie.cases[0][0].base = new BaseHumain(partie.joueur1);
		partie.cases[0][0].base.position = partie.cases[0][0];
		
		//TOUR J1
				partie.cases[0][1].unite = new Tour(partie.joueur1);
				partie.cases[0][1].unite.position = partie.cases[0][1];
				
		partie.cases[0][8].base = new BaseNavaleHumain(partie.joueur1);
		partie.cases[0][8].base.position = partie.cases[0][8];
		// BASE NEUTRE
		partie.cases[5][5].base = new BaseNeutre();
		partie.cases[5][5].base.position = partie.cases[5][5];
		
		//TOUR J2
				partie.cases[partie.getNbLignes()-1][partie.getNbColonnes()-2].unite = new Tour(partie.joueur2);
				partie.cases[partie.getNbLignes()-1][partie.getNbColonnes()-2].unite.position = 
						partie.cases[partie.getNbLignes()-1][partie.getNbColonnes()-2];

		partie.cases[partie.getNbLignes() - 1][partie.getNbColonnes() - 1].base = new BaseOrque(
				partie.joueur2);
		partie.cases[partie.getNbLignes() - 1][partie.getNbColonnes() - 1].base.position = partie.cases[partie
				.getNbLignes() - 1][partie.getNbColonnes() - 1];
		
		
		partie.brouillardDeGuerre();
		boutonTest = (Button) findViewById(R.id.fin);
		boutonTest.setOnClickListener(this);
	}

}
*/